<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent">
    <div class="flex-box border-hover-style">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img
        class="outline-parent-bg"
        :src="publicUrls + 'free/style11/Level3outlineStyle3Bg.webp'"
        alt=""
      />
      <div class="outline">
        <div class="outline-title">
          {{ props.info.text }}
        </div>
        <div class="outline-subTitle" v-if="props.info.subTitle">
          <p>——{{ props.info.subTitle }}</p>
        </div>
        <TextMax
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="
            props.info.value && props.info.subTitle
              ? 4
              : !props.info.value && !props.info.subTitle
              ? 11
              : props.info.value && !props.info.subTitle
              ? 6
              : 8
          "
        ></TextMax>
        <div class="outline-cover" v-if="props.info.value">
          <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
        </div>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style11/firstLevelOutline1Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free11Style3',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style11.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';

const store = useProjectStore();
const ImgVisible = ref(false);

interface Props {
  info: {
    digitalShowroom?: string;
    id?: string | number;
    text: string;
    subTitle?: string;
    remarks?: string;
    value?: string;
  };
  domShow: boolean;
}

const props = withDefaults(defineProps<Props>(), {
  domShow: false,
});

// 跳转全景链接
const open = (url: string) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 280px;
  .shadow {
    width: 176px;
    height: 200px;
    position: absolute;
    bottom: 0;
    right: -146px;
  }
}

.flex-box {
  width: 458px;
  height: 684px;
  display: flex;
  flex-direction: column;
  justify-content: start;
  position: relative;
  padding-left: 65px;
  padding-top: 90px;
}

.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: start;
  width: 320px;
  height: 100%;
  padding-bottom: 144px;
}
.outline-title {
  width: 100%;
  position: relative;
  font-family: SourceHanSerifCN-Bold;
  text-align: center;
  font-size: 20px;
  line-height: 32px;
  color: #ffecc3;
  text-shadow: 0px 5px 3px rgba(0, 0, 0, 0.3), 0px 2px 0px #726751;
  margin-bottom: 16px;
}
.outline-subTitle {
  width: 100%;
  margin-bottom: 24px;
  ::v-deep p {
    color: #fff;
    text-align: center;
    font-family: SourceHanSerifCN;
    font-size: 16px;
    line-height: 28px;
  }
}
.outline-cover {
  width: 200px;
  height: 100%;
  max-height: 396px;
  flex: 1;
  overflow: hidden;
  background: #998367;
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}

.Showroom-parent {
  position: absolute;
  top: 20px;
  right: 50px;
  z-index: 21;
}
::v-deep .textMore-box {
  width: 230px;
  margin-bottom: 16px;
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: #fff !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #ffecc3 !important;
  font-weight: 400 !important;
}
</style>